!{include file='common/iheader.htm'}
<div id="i_nav">
	<h3 class="page_title">分类管理</h3>
	<a class="button" href="/admin.php?app=widget&act=cate_edit">添加分类</a> 
</div>
<ul class="list_view">
	!{foreach from=$widget_cates item=cate key=cate_key}
	<li id="cate_!{$cate_key}">
		<strong>
			[!{$cate_key}] <a href="/admin.php?app=widget&act=cate_edit&id=!{$cate_key}" title="!{$cate.desc}">!{$cate.name}</a>
			!{if $cate.desc}
			<span class="ui-icon ui-icon-info" title="!{$cate.desc}"></span>
			!{/if}
		</strong>
		<div class="opt_div">
			<a href="/admin.php?app=widget&act=cate_edit&id=!{$cate_key}"><span class="ui-icon ui-icon-pencil"></span>修改</a>
			<a href="javascript:void(0)" onclick="del('!{$cate_key}')"><span class="ui-icon ui-icon-trash"></span>删除</a>
		</div>
	</li>
	!{foreachelse}
	<li>
		<strong>暂无记录...</strong>
	</li>
	!{/foreach}
</ul>
<script>
	function del(code){
		if(confirm('此操作将会删除此记录，但不会删除文件，删除将造成此分类下的组件再不可以使用，是否继续？')){
			var url = '/admin.php?app=widget&act=cate_del&id=' + code;
			$.get(url,function(data){
				var json = eval('('+data+')');
				alert(json.info);
				if(json.result){
					$('#cate_' + code).remove();
				}
			});
		}
	}
</script>
!{include file='common/ifooter.htm'}